import {AxiosPost} from "./HttpService";

let linkClickMap: any = {
    addOperationLog: (node: any = {}) => {
        AxiosPost("/log", {
            objectId: node.id,
            templateCode: "2012"
        });
    }
}

// @ts-ignore
const getLinkClickByKey: Function = (key: string) => {
    return linkClickMap[key];
};

// @ts-ignore
const expandLinkClickMap: Function = (key: string, expandFun: object) => {
    linkClickMap = {
        ...linkClickMap,
        [key]: expandFun
    };
};

export {
    getLinkClickByKey,
    expandLinkClickMap
}